

<%@ page import="com.pandorasoft.shop.Shop" %>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="layout" content="kickstart" />
	<g:set var="entityName" value="${message(code: 'shop.label', default: 'Shop')}" />
	<title><g:message code="default.edit.label" args="[entityName]" /></title>
</head>

<body>

<section id="edit" class="first">

	<g:hasErrors bean="${shopInstance}">
	<div class="alert alert-error">
		<g:renderErrors bean="${shopInstance}" as="list" />
	</div>
	</g:hasErrors>

	<g:form method="post" class="form-horizontal" >
		<g:hiddenField name="id" value="${shopInstance?.id}" />
		<g:hiddenField name="version" value="${shopInstance?.version}" />
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'name', 'error')}">
							<label for="name"><g:message code="shop.name.label" default="Name" /></label>
							<div class="controls">
								<g:textField name="name" value="${shopInstance?.name}" />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'name', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'province', 'error')}">
							<label for="province"><g:message code="shop.province.label" default="Province" /></label>
							<div class="controls">
								<g:textField name="province" value="${shopInstance?.province}" />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'province', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'location', 'error')}">
							<label for="location"><g:message code="shop.location.label" default="Location" /></label>
							<div class="controls">
								<g:textField name="location" value="${shopInstance?.location}" />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'location', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'tel', 'error')}">
							<label for="tel"><g:message code="shop.tel.label" default="Tel" /></label>
							<div class="controls">
								<g:textField name="tel" value="${shopInstance?.tel}" />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'tel', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'phone', 'error')}">
							<label for="phone"><g:message code="shop.phone.label" default="Phone" /></label>
							<div class="controls">
								<g:textField name="phone" value="${shopInstance?.phone}" />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'phone', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'googleMap', 'error')}">
							<label for="googleMap"><g:message code="shop.googleMap.label" default="Google Map" /></label>
							<div class="controls">
								<g:textField name="googleMap" value="${shopInstance?.googleMap}" />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'googleMap', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'company', 'error')}">
							<label for="company"><g:message code="shop.company.label" default="Company" /></label>
							<div class="controls">
								<g:select name="company.id" from="${com.pandorasoft.shop.Company.list()}" optionKey="id" value="${shopInstance?.company?.id}"  />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'company', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'consumers', 'error')}">
							<label for="consumers"><g:message code="shop.consumers.label" default="Consumers" /></label>
							<div class="controls">
								
<ul>
<g:each in="${shopInstance?.consumers?}" var="c">
    <li><g:link controller="consumer" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="consumer" action="create" params="['shop.id': shopInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'consumer.label', default: 'Consumer')])}</g:link>

								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'consumers', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'employees', 'error')}">
							<label for="employees"><g:message code="shop.employees.label" default="Employees" /></label>
							<div class="controls">
								
<ul>
<g:each in="${shopInstance?.employees?}" var="e">
    <li><g:link controller="employee" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="employee" action="create" params="['shop.id': shopInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'employee.label', default: 'Employee')])}</g:link>

								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'employees', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shopInstance, field: 'shopType', 'error')}">
							<label for="shopType"><g:message code="shop.shopType.label" default="Shop Type" /></label>
							<div class="controls">
								<g:select name="shopType.id" from="${com.pandorasoft.shop.ShopType.list()}" optionKey="id" value="${shopInstance?.shopType?.id}"  />
								<span class="help-inline">${hasErrors(bean: shopInstance, field: 'shopType', 'error')}</span>
							</div>
						</div>
				
		<div class="form-actions">
			<g:actionSubmit class="save btn-primary" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
			<g:actionSubmit class="delete btn-danger" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
            <button class="btn" type="reset">Cancel</button>
		</div>
	</g:form>

</section>
			
</body>

</html>
